package com.acme.bankapp.service.bank;

import com.acme.bankapp.domain.bank.Bank;
import com.acme.bankapp.domain.bank.CheckingAccount;
import com.acme.bankapp.domain.bank.Client;
import com.acme.bankapp.domain.bank.Gender;
import com.acme.bankapp.domain.bank.SavingsAccount;

public class BankApplication {

	public static void modifyBank(){
		
		BankService bankService = new BankService();
		Bank bank = BankService.createNewBank();
		
		Client client1 = new Client(new CheckingAccount(50, 100));
		Client client2 = new Client(new CheckingAccount(30));
		
		BankService.addClient(bank, client1);
		BankService.addClient(bank, client2);
			
		BankService.printBalance(bank);
		
		System.out.println("------");
		
		client1.getAccount().withdraw(70);
		client2.getAccount().deposit(30);
		
		BankService.printBalance(bank);
		
		
	}
	
	public static void main(String[] args) {
		BankService bankService = new BankService();
		Bank bank = bankService.createNewBank();
		
		Client curclient = new Client(new SavingsAccount(10));
		
		BankService.addClient(bank, curclient);
		
		curclient.setName("111");
		curclient.setGengerType(Gender.FEMALE);
		
		BankService.addClient(bank, new Client(new CheckingAccount(20)));
		BankService.addClient(bank, new Client(new CheckingAccount(30)));
		
		
		System.out.println("------");
		bankService.printBalance(bank);
		
		System.out.println("------");
		modifyBank();

	}

}
